//
//  YeeShopInfoVC.m
//  YeeShopProject
//
//  Created by CoderYee on 2017/3/6.
//  Copyright © 2017年 CoderYee. All rights reserved.
//

#import "YeeShopInfoVC.h"
#import "YeeShopDetailSubsVC.h"

@interface YeeShopInfoVC ()

@end

@implementation YeeShopInfoVC

- (void)viewDidLoad
{
    [super viewDidLoad];
}

-(void)addOwnViews
{
    [super addOwnViews];
    //[self.view setBackgroundColor:[UIColor redColor]];
}
-(void)addNavbarView
{
    [super addNavbarView];
}
-(void)configOwnViews
{
    [super configOwnViews];
    self.tableView.frame=CGRectMake(0, 0, kMainScreenWidth, kcontentViewHeight-40);
    [self.tableView setBackgroundColor:xBackgroundColor];
    //self.tableView.mj_header.ignoredScrollViewContentInsetTop=-40;
    [self   tablePullupHeaderRefresh:^{
        
    }];
}
-(void)addrefreshHeaderView
{
    //这里需要动态更改view的位置
    UIView *view=[[UIView alloc] initWithFrame:CGRectMake(0, self.tableView.frame.size.height, kMainScreenWidth, 40)];
    [view setBackgroundColor:xBackgroundColor];
    UILabel *lable=[[UILabel alloc] initWithFrame:CGRectMake(0, 10, kMainScreenWidth, 21)];
    lable.textAlignment=NSTextAlignmentCenter;
    lable.text=@"上拉刷新获取更多精彩";
    lable.font=[UIFont systemFontOfSize:14];
    
    // view
   // _headerView=view;
    [view addSubview:lable];
    [self.tableView addSubview:view];
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 50;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:NSStringFromClass([UITableViewCell class])];
    if (cell==nil)
    {
        cell=[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([ UITableViewCell class])];
    }
   
    return cell;
}
-(UIView*)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
{
    UIView *view=[[UIView alloc] init];
    return view;
}
-(UIView*)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
    UIView *view=[[UIView alloc] initWithFrame:CGRectMake(0, 0, kMainScreenWidth, 0.01)];
    return view;
}
-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{
    return 0.01;
}
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
    return 0.01;
}

- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
//    MJRefreshStateHeader * header =(MJRefreshStateHeader*)self.tableView.mj_header;
//    CGFloat orginY = - (54 + 40);
//    if (header.mj_y != orginY)
//    {
//        header.mj_y = orginY;
//    }
//    [_detailSubsVC configTableViewDidScrollView:self.tableView];
}
- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
